package com.gitee.faster.redis.protocol;

import lombok.Data;
import lombok.experimental.Accessors;

import java.net.InetSocketAddress;
import java.util.List;

/**
 * @author hongda.li
 */
@Data
@Accessors(chain = true)
public class RedisRequest {

    private final Long timestamp;

    private final String sessionId;

    private final List<String> dataList;

    private final InetSocketAddress address;

    public RedisRequest(RedisRequest request) {
        this.address = request.getAddress();
        this.dataList = request.getDataList();
        this.sessionId = request.getSessionId();
        this.timestamp = System.currentTimeMillis();
    }

    public RedisRequest(String sessionId, InetSocketAddress address, List<String> dataList) {
        this.address = address;
        this.dataList = dataList;
        this.sessionId = sessionId;
        this.timestamp = System.currentTimeMillis();
    }
}
